package com.design.model;

/**
 * 工厂方法例子
 *
 * @author lw
 * @date 2023/12/1 14:03
 **/
public class FactoryMethodExample {

    public static void main(String[] args) {
        ShapeFactory shapeFactory1 = new CircleFactory();
        Shape shape1 = shapeFactory1.createShape();
        shape1.draw();

        ShapeFactory shapeFactory2 = new RectangleFactory();
        Shape shape2 = shapeFactory2.createShape();
        shape2.draw();
    }
}
